<?php
  session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>外卖网-会员中心</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> 
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script type="text/javascript" src="js/lrtk.js"></script>
<script type="text/javascript"> 
$(function(){ 
//Default Action 
$(".tab_content").hide(); //Hide all content 
$("ul.tabs li:first").addClass("active").show(); //Activate first tab 
$(".tab_content:first").show(); //Show first tab content 
//On Click Event 
$("ul.tabs li").click(function() { 
$("ul.tabs li").removeClass("active"); //Remove any "active" class 
$(this).addClass("active"); //Add "active" class to selected tab 
$(".tab_content").hide(); //Hide all tab content 
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 
$(activeTab).fadeIn(); //Fade in the active content 
return false; 
}); 
}); 
</script> 
<script type="text/javascript"> 
function huifu(thisid){
 $("#pingjiatext"+thisid).html("未评价");



}
function gaibiantext(thisid,xingxing){

if(xingxing==1){

  $("#pingjiatext"+thisid).html("非常差");


}else if(xingxing==2){

  $("#pingjiatext"+thisid).html("真的是差");


}else if(xingxing==3){

  $("#pingjiatext"+thisid).html("一般");


}else if(xingxing==4){

  $("#pingjiatext"+thisid).html("很好");


}else if(xingxing==5){

  $("#pingjiatext"+thisid).html("太完美了");


}


}
function goPingjia(thisid,parentid){

  
  $("#serve"+parentid+thisid).attr("sign","isselecked");
  $("#jia"+parentid+thisid).attr("class","star_rating2");  

  $("a[name*='xingjin"+parentid+thisid+"']").attr("onmouseover","");
  $("a[name*='xingjin"+parentid+thisid+"']").attr("onmouseout","");
var xingxing=$("#serve"+parentid+thisid).val();
if(xingxing==1){

  $("#pingjiatext"+parentid+thisid).html("非常差");


}else if(xingxing==2){

  $("#pingjiatext"+parentid+thisid).html("真的是差");


}else if(xingxing==3){

  $("#pingjiatext"+parentid+thisid).html("一般");


}else if(xingxing==4){

  $("#pingjiatext"+parentid+thisid).html("很好");


}else if(xingxing==5){

  $("#pingjiatext"+parentid+thisid).html("太完美了");


}

var hrefvalue="caiid="+thisid+"&parentid="+parentid+"&xingxing="+xingxing;
$.ajax({ 
    type:'get', //传送的方式,get/post 
    url:'pinglunstarts.php', //发送数据的地址 
    cache:'false', 
    data:hrefvalue, 
    dataType: 'text',
    success:function(data) 
    { if(data="yes"){

      alert("评级成功")
    }else {
      alert("评级失败");
    }
    }
  });

}
$(function(){
$('#login').click(function(){   //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
	width: '490px',
	top:  ($(window).height() - 290) /2 + 'px', 
    left: ($(window).width() - 490) /2 + 'px', 
	cursor: 'auto'
       },
  overlayCSS: {
	opacity: '0.7' 
	          }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

});

$('#shoplogin').click(function(){   //给box_btn绑定一个鼠标点击的事件
  $.blockUI({    //当点击事件发生时调用弹出层
    message: $('#loginbox'),    //要弹出的元素box
    css: {    //弹出元素的CSS属性
      border:'5px solid #334343',
      textAlign: 'left',
    width: '490px',
    top:  ($(window).height() - 290) /2 + 'px', 
      left: ($(window).width() - 490) /2 + 'px', 
    cursor: 'auto'
         },
    overlayCSS: {
    opacity: '0.7' 
              }
   });
  $('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
  $('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层
  $("#alllogin").attr("action","login-shop.php");
  });

});
</script> 
<style type="text/css">
<!--


.star_rating2 {list-style:none;margin:-1px 0 0 -1px; padding:0; width:70px; height:12px; position:relative; background:url(./img/rating_stars.gif) 0 0 repeat-x; overflow:hidden;font-size:0;}
.star_rating2 li{padding:0;margin:0;float:left;}
.star_rating2 li a{display:block;width:14px;height:12px;text-decoration:none;text-indent:-9000px;z-index:20;position:absolute;padding:0;margin:0;}

.star_rating2 a.one_star{left:0;}
.star_rating2 a.one_star:hover{width:14px;}
.star_rating2 a.two_stars{left:14px;}
.star_rating2 a.two_stars:hover{width:28px;}
.star_rating2 a.three_stars{left:28px;}
.star_rating2 a.three_stars:hover{width:42px;}
.star_rating2 a.four_stars{left:42px;}
.star_rating2 a.four_stars:hover{width:56px;}
.star_rating2 a.five_stars{left:56px;}
.star_rating2 a.five_stars:hover{width:70px;}
.star_rating2 li.current_rating{background:url(./img/rating_stars.gif) 0 24px;position:absolute;height:12px;display:block;text-indent:-9000px;z-index:1;left:0;}

.star_rating {list-style:none;margin:-1px 0 0 -1px; padding:0; width:70px; height:12px; position:relative; background:url(./img/rating_stars.gif) 0 0 repeat-x; overflow:hidden;font-size:0;}
.star_rating li{padding:0;margin:0;float:left;}
.star_rating li a{display:block;width:14px;height:12px;text-decoration:none;text-indent:-9000px;z-index:20;position:absolute;padding:0;margin:0;}
.star_rating li a:hover{background:url(./img/rating_stars.gif) 0 12px;z-index:2;left:0;}
.star_rating a.one_star{left:0;}
.star_rating a.one_star:hover{width:14px;}
.star_rating a.two_stars{left:14px;}
.star_rating a.two_stars:hover{width:28px;}
.star_rating a.three_stars{left:28px;}
.star_rating a.three_stars:hover{width:42px;}
.star_rating a.four_stars{left:42px;}
.star_rating a.four_stars:hover{width:56px;}
.star_rating a.five_stars{left:56px;}
.star_rating a.five_stars:hover{width:70px;}
.star_rating li.current_rating{background:url(./img/rating_stars.gif) 0 24px;position:absolute;height:12px;display:block;text-indent:-9000px;z-index:1;left:0;}


.jia{


}
#www_zzjs_net p{margin:20px 0 5px 0;}
-->
</style>













</head>

<body>

<div id="loginbox" style="display:none">
  <div class="login_title">会员登录</div>
  <div class="login_input">
    <div class="input"><span>账号：</span><span><input name="user" type="text" /></span></div>
    <div class="input"><span>密码：</span><span><input name="pwd" type="password" /></span></div>
    <div class="login_input_1 clearfix"><input name="" type="checkbox" value="" id="store1" /><label for="store1">自动登录</label><a href="#">找回密码</a></div>
    <div class="reg clearfix"><span><input class="login_btn" name="" type="image" src="images/login.jpg" /></span><span>还没有账号？</span><a href="#">立即注册</a></div>
  </div>
</div>

<div class="top">
  <div class="top_content clearfix"><span class="left"><a href="index.php"><img src="images/wmwlogo.png"></a></span><span class="right">
 
  <?php
    if(isset($_SESSION['username'])){
      if($_SESSION['logintype']=="userlog"){
     echo '<a href="member.php">'.$_SESSION['username'],'欢迎你！</a>';
}elseif ($_SESSION['logintype']=="supplierlog") {
   echo '<a href="shop-xx.php">'.$_SESSION['username'],'欢迎你！</a>';
}
      echo '<a href="login.php?action=logout">登出</a>';
    }else{
      echo ' <a href="#" id="login">';
      echo '登录';
      echo '</a> / <a href="reg11.php">注册</a>';
    }
  ?>
  <?php  
      if(!isset($_SESSION['username'])  ){
   ?>
  | <a href="#"  id="shoplogin">店铺登录</a></span></div>
  <?php 
    }

   ?>
</div>

<div class="content clearfix">
  <div class="content_con clearfix">
    <div class="box_left left">
      <div class="box">
        <div class="box_title"><div class="box_title_con left">
            <?php
              echo $_SESSION['username'];
            ?></div>
            <?php
            if($_SESSION['userlevel']==0){

            ?>
            <div class="lv1 left">
              <?php

                }else{
              ?>
        <div class="lv<?php echo $_SESSION['userlevel'] ?> left">
<?php 
  }
?>
            </div></div>
        <ul class="clearfix box_ul">
          <li  class="liselect"><span class="ico2select"><a href="member.php">我的订单</a></span></li>
          <li ><span class="ico8"><a href="member-dd.php">订单明细</a></span></li>
          <li><span class="ico3"><a href="member-add.php">我的地址</a></span></li>
          <li><span class="ico4"><a href="member-edpass.php">修改密码</a></span></li>
        </ul>
      </div>
    </div>
    <div class="box_right right">
      <div class="box">
        <div id="www_zzjs_net" star_width="14" >
        <div class="box_title"><div class="box_title_title">我的订单</div></div>
       

        <?php
        include('system/db/conn.php');

            date_default_timezone_set("Asia/Shanghai");
          $i = 1 ;
          $area_query = mysql_query("select * from do_deal_order where user_id=".$_SESSION['userid']." order by create_time desc");
          while($row = mysql_fetch_array($area_query)){
          $local_array = mysql_query("select dsl.*,ds.* from do_supplier_location dsl,do_supplier ds where dsl.supplier_id=".$row['supplier_id']." and dsl.supplier_id=ds.id");
			$row2 = mysql_fetch_row($local_array);
      
						mysql_free_result($local_array);

?>
<div class="box_content" style="border:0px;padding-top:0px;">
          <div class="box_critique clearfix">
            <div class="critique_tit">

          <?php
          		 if($row['order_status']==1){
              echo "订单处理中";

            }elseif ($row['order_status']==2) {
              echo "订单退订中";
            }elseif ($row['order_status']==3) {
              echo "订单已完成";
            }


          ?>



            @<?php echo $row2[1] ?></div>
            <div class="critique_info">
              <span><b>订单单号:</b> <?php echo $row['order_sn'] ?></span>
              <span><b>下单时间:</b> <?php echo date("Y-m-j H:i:s",$row['create_time']) ?></span>
              <span><b>餐厅电话:</b>  <?php  echo $row2[4]; ?></span>
              <span><b>订单地址:</b> <?php echo $row['address'] ?></span>
              <span><b>联系电话:</b> <?php echo $row['mobile'] ?></span>
              <span><b>订单备注:</b> 
              <?php 
              if($row['ordermessage']=="undefined"){
              echo "";
}else{

  $row['ordermessage']; 
}

               ?></span>
            </div>
          </div>
          <div class="box_critique">
            <table border="0" cellpadding="0" cellspacing="0" class="critique_list">
              <tr>
                <th width="250" class="list_left">订单</th>
                <th class="list_left"></th>
                <th width=""></th>
                <th width="80">单价</th>
                <th width="80">数量</th>
                <th width="50" class="list_right">小计</th>
              </tr>
              <?php 
              	if(is_null($row['food'])||$row['food']==""){

              	}else{
              		$arrayzhengti = split(" ",$row['food']);
              		
					
				$count_array = count($arrayzhengti);
					$shuliang=0;
$x=0;
				for($x==0;$x<$count_array;$x++){
					
				$arrayFensan=split(",",$arrayzhengti[$x]);	
        $anothercount_array=count($arrayFensan); 
				$shuliang+=$arrayFensan[1];
			$local_array2 = mysql_query("select * from do_supplier_location_menu 	 where id=".$arrayFensan[0]);

			$row3 = mysql_fetch_row($local_array2);
				
			mysql_free_result($local_array2);
              ?>
              <tr class="list_vary_tr">
                <td width="250" class="list_left"><?php echo $row3[2] ?></td>
                <td style="position: relative;">
               
               <?php

               if($anothercount_array<3){
               ?>
  <ul class="star_rating" style="float:left;display:block;padding-top：3px;" id="jia<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" >
   <li style="">
    <input type="text" sign="" style="background-color:   transparent;   border:   0px " name="serve<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" id="serve<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onchange="goPingjia(<?php echo $arrayFensan[0] ?>,<?php echo $row['id'] ?>)" value="" />
   </li>
   <li class="current_rating">default level</li>
   <li><a href="###" name="xingjin<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onmouseover="gaibiantext(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>,1)" onmouseout="huifu(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>)"  class="one_star">1</a></li>
   <li><a href="###" name="xingjin<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onmouseover="gaibiantext(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>,2)"  onmouseout="huifu(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>)" class="two_stars">2</a></li>
   <li><a href="###" name="xingjin<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onmouseover="gaibiantext(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>,3)"  onmouseout="huifu(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>)" class="three_stars">3</a></li>
   <li><a href="###" name="xingjin<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onmouseover="gaibiantext(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>,4)"  onmouseout="huifu(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>)" class="four_stars">4</a></li>
   <li><a href="###" name="xingjin<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>" onmouseover="gaibiantext(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>,5)"  onmouseout="huifu(<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>)" class="five_stars">5</a></li>
  </ul>
 <?php

}
 ?>
                  
                </td>
                <td id="pingjiatext<?php echo $row['id'] ?><?php echo $arrayFensan[0] ?>">
                <?php

                   if($anothercount_array<3){
                      echo "未评价";
                    }else{
                      echo "已评价";
                    }

                ?>
</td>
                <td width="80" align="center">￥<?php echo  round($row3[4],1) ?></td>
                <td width="80" align="center"><?php echo $arrayFensan[1] ?></td>
                <td width="50" class="list_right">￥<?php echo $arrayFensan[1]*$row3[4] ?></td>
              </tr>
 			<?php 
					}
				}
              ?>
              <tr class="topline">
                <th width="250" class="list_left"></th>
                <th class="list_left"></th>
                <th width="80"></th>
                <th width="80"></th>
                <th width="50" class="list_right">合计</th>
              </tr>
              <tr>
                <th width="250" class="list_left"></th>
                <th class="list_left"></th>
                <th width="80"></th>
                <th width="80">
<!-- 
                <?php

				if(is_null($row['food'])||$row['food']==""){

              	}else{
                 echo $shuliang; 

					}

                 ?> -->

                </th>
                <th width="50" class="list_right">￥<?php echo  round($row['total_price'],1) ?></th>
              </tr>
            </table>
          </div>
        </div>

<?php

          }
          mysql_free_result($area_query);
        ?>









 </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
<!--
function __start(){
 var initialize_width=0;
 if(document.getElelmentById){return false};
 if(document.getElementsByTagName==null){return false;}
 var startLevelObj=document.getElementById("www_zzjs_net")
 if(startLevelObj==null){return false;}
 initialize_width=parseInt(startLevelObj.getAttribute("star_width"),10);
 if(isNaN(initialize_width) || initialize_width==0){return false;}
 var ul_obj=startLevelObj.getElementsByTagName("ul");
 if(ul_obj.length<1){return false;}
 var length=ul_obj.length;
 var li_length=0;
 var a_length=0;
 var li_obj=null;
 var a_obj=null;
 var defaultInputObj=null;
 var defaultValue=null;
 for(var i=0;i<length;i++){
  li_obj=ul_obj[i].getElementsByTagName("li");
  li_length=li_obj.length;
  if(li_length<0){return false;}
  //获取默认值
  defaultInputObj=li_obj[0].getElementsByTagName("input");if(!defaultInputObj){return false;}
  defaultValue=parseInt(defaultInputObj[0].value,10);
  if(!isNaN(defaultValue) && defaultValue!=0){
   //alert("有初始值!");
   //li_obj[1].style.width=initialize_width*defaultValue+"px";
   //defaultValue=0;
  }
  for(var j=0;j<li_length;j++){
   a_obj=li_obj[j].getElementsByTagName("a");
   if(a_obj.length<1){continue;}
   if(a_obj[0].className.indexOf("star")>0){
    a_obj[0].onclick=function(){
     return give_value(this);
    }
    a_obj[0].onfocus=function(){
     this.blur();
    }
   }
  }
 }
}//欢迎来到站长特效网，我们的网址是www.zzjs.net，很好记，zz站长，js就是js特效，本站收集大量高质量js代码，还有许多广告代码下载。
function give_value(obj){
 var status=true;
 var parent_obj=obj.parentNode;
 var i=0;
 while(status){
  i++;
  if(parent_obj.nodeName=="UL"){break;}
  parent_obj=parent_obj.parentNode;
  if(i>1000){break;}//防止找不到ul发生死循环
 }
 var hidden_input=parent_obj.getElementsByTagName("input")[0];
 if(hidden_input.length<1){/*alert("sorry?\nprogram error!")*/;}
 var txt=obj.firstChild.nodeValue;//确保不能存在空格哦，因为这里用的firstChild
 if(isNaN(parseInt(txt,10))){/*alert('level error!')*/;return false;}
  hidden_input.focus();
  if(hidden_input.getAttribute('sign')=="isselecked"){
    return false;
  }
 hidden_input.setAttribute("value",txt.toString());

 //固定选中状态,先找到初始化颜色那个li
 var current_li=parent_obj.getElementsByTagName("li");
 var length=current_li.length;
 var ok_li_obj=null;
 for(var i=0;i<length;i++){
  if(current_li[i].className.indexOf("current_rating")>=0){
   ok_li_obj=current_li[i];break;//找到
  }
 }
 __current_width=txt*14;
 ok_li_obj.style.width=__current_width+"px";
 return false;
}//欢迎来到站长特效网，我们的网址是www.zzjs.net，很好记，zz站长，js就是js特效，本站收集大量高质量js代码，还有许多广告代码下载。
__start();
//-->
</script>
<?php include('bottom.php') ?>
</body>
</html>
